package com.utf999.qiangmanger.entity.orm;

import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.utf999.qiangmanger.entity.UUIDEntity;

/**
 * 店面信息
 * @author yinwenjie
 */
@Entity
@Table(name="B_Storefront")
public class StorefrontEntity extends UUIDEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = -7884978066787074128L;

	/**
	 * 店面名称
	 */
	@Column(name="storeName" , length=128 , nullable=false)
	private String storeName = "";
	
	/**
	 * 店面地址
	 */
	@Column(name="storeAddress" , length=225 , nullable=false)
	private String storeAddress = "";
	
	/**
	 * 店面联系电话
	 */
	@Column(name="storePhone" , length=64 , nullable=false)
	private String storePhone = "";
	
	/**
	 * 创建时间
	 */
	@Column(name="createTime" , nullable=false)
	private Date createTime;
	
	/**
	 * 店面状态信息<br>
	 * 1、正常
	 * 0/其他值、作废
	 */
	@Column(name="status" , nullable=true)
	private Integer status = 1;
	
	/**
	 * 所属公司信息
	 */
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="company" , nullable=false)
	private CompanyEntity company;
	
	/**
	 * 记录了属于该门店的所有管理员的集合
	 */
	@OneToMany(fetch=FetchType.LAZY , mappedBy="storefront")
	private Set<AdminUserEntity> admins;
	
	public String getStoreName() {
		return storeName;
	}

	public void setStoreName(String storeName) {
		this.storeName = storeName;
	}

	public String getStoreAddress() {
		return storeAddress;
	}

	public void setStoreAddress(String storeAddress) {
		this.storeAddress = storeAddress;
	}

	public String getStorePhone() {
		return storePhone;
	}

	public void setStorePhone(String storePhone) {
		this.storePhone = storePhone;
	}

	public CompanyEntity getCompany() {
		return company;
	}

	public void setCompany(CompanyEntity company) {
		this.company = company;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Override
	public String getUniqueKey() {
		return "uid";
	}
}